using System;
using System.Text;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;

using Afrs.Draco.Prms.Client.Proxy;
using Afrs.Prms.DataObject;

namespace 
{
  /// <summary>
  /// ReportsFoldersReadyForMergingSummary Test Class
  /// </summary>
  [TestClass]
  public class TestReportsFoldersReadyForMergingSummary
  {
    #region Class Variables
    private CdoPrms<DOReportsFoldersReadyForMergingSummary>		m_ReportsFoldersReadyForMergingSummary;
    private CdoPrmsList<DOReportsFoldersReadyForMergingSummary>	m_AllReportsFoldersReadyForMergingSummary;
    #endregion

    #region Class Constructors & Destructors
    /// <summary>
    /// Constructs the test
    /// </summary>
    public TestReportsFoldersReadyForMergingSummary()
    {
      // Create the data objects
      this.m_ReportsFoldersReadyForMergingSummary	= new CdoPrms<DOReportsFoldersReadyForMergingSummary>();
      this.m_AllReportsFoldersReadyForMergingSummary	= new CdoPrmsList<DOReportsFoldersReadyForMergingSummary>();
    }
    #endregion

    #region Class Methods
    /// <summary>
    /// Retrieves all ReportsFoldersReadyForMergingSummary data objects
    /// </summary>
    [TestMethod]
    public void ReportsFoldersReadyForMergingSummaryRetrieveAll()
    {
      // Set up the data object for list retrieval
      this.m_AllReportsFoldersReadyForMergingSummary.DataObject = new DOReportsFoldersReadyForMergingSummary();
      this.m_AllReportsFoldersReadyForMergingSummary.ListAction = AfrsDOListAction.Retrieve;

      // Perform the action and determine the success
      if (!this.m_AllReportsFoldersReadyForMergingSummary.PerformAction())
      {
        // Assert the errors
        if (this.m_AllReportsFoldersReadyForMergingSummary.Errors.Count > 0) { Assert.Fail(this.m_AllReportsFoldersReadyForMergingSummary.Errors[0].Message); }
        else { Assert.Fail("Unknown error occurred"); }
      }

      // Return to calling method
      return;
    }

    /// <summary>
    /// Create a new ReportsFoldersReadyForMergingSummary
    /// </summary>
    [TestMethod]
    public void ReportsFoldersReadyForMergingSummaryCreate()
    {
      // Set up the data object for creation
      this.m_ReportsFoldersReadyForMergingSummary.DataObject.FILENO = 'b';
      this.m_ReportsFoldersReadyForMergingSummary.DataObject.d_id = "Test d_id";
      this.m_ReportsFoldersReadyForMergingSummary.DataObject.d_folder = "Test d_folder";
      this.m_ReportsFoldersReadyForMergingSummary.DataObject.d_loc = "Test d_loc";
      this.m_ReportsFoldersReadyForMergingSummary.DataObject.ILPNO = 'b';
      this.m_ReportsFoldersReadyForMergingSummary.DataObject.a_code = 'b';
      this.m_ReportsFoldersReadyForMergingSummary.DataObject.a_desc = 'b';
      this.m_ReportsFoldersReadyForMergingSummary.DataObject.a_from = 'b';
      this.m_ReportsFoldersReadyForMergingSummary.DataObject.a_to = 'b';
      this.m_ReportsFoldersReadyForMergingSummary.DataObject.d_status = "Test d_status";
      this.m_ReportsFoldersReadyForMergingSummary.DataObject.d_match = false;
      this.m_ReportsFoldersReadyForMergingSummary.DataObject.d_exist = false;
      this.m_ReportsFoldersReadyForMergingSummary.DataObject.FSTATUS = 'b';
      this.m_ReportsFoldersReadyForMergingSummary.DataObject.LOCNO = 'b';
      this.m_ReportsFoldersReadyForMergingSummary.DataObject.d_accno = "Test d_accno";
      this.m_ReportsFoldersReadyForMergingSummary.DataObject.d_doctype = "Test d_doctype";
      this.m_ReportsFoldersReadyForMergingSummary.DataObject.d_lasttran = DateTime.Now;
      this.m_ReportsFoldersReadyForMergingSummary.DataObject.Action = AfrsDataObjectAction.Create;

      // Perform the action and determine the success
      if (!this.m_ReportsFoldersReadyForMergingSummary.PerformAction())
      {
        // Assert the errors
        if (this.m_ReportsFoldersReadyForMergingSummary.Errors.Count > 0) { Assert.Fail(this.m_ReportsFoldersReadyForMergingSummary.Errors[0].Message); }
        else { Assert.Fail("Unknown error occurred"); }
      }

      // Return to calling method
      return;
    }

    /// <summary>
    /// Retrieves a specific ReportsFoldersReadyForMergingSummary
    /// </summary>
    [TestMethod]
    public void ReportsFoldersReadyForMergingSummaryRetrieve()
    {
      // Determine whether the data object needs to be specified
      if (this.m_ReportsFoldersReadyForMergingSummary.DataObject.Id == 0)
      {
        // Specify the data object to retrieve
        this.m_ReportsFoldersReadyForMergingSummary.DataObject.tuser = 'b';
      }

      // Set up the data object action for retrieval
      this.m_ReportsFoldersReadyForMergingSummary.DataObject.Action = AfrsDataObjectAction.Retrieve;

      // Perform the action and determine the success
      if (!this.m_ReportsFoldersReadyForMergingSummary.PerformAction())
      {
        // Assert the errors
        if (this.m_ReportsFoldersReadyForMergingSummary.Errors.Count > 0) { Assert.Fail(this.m_ReportsFoldersReadyForMergingSummary.Errors[0].Message); }
        else { Assert.Fail("Unknown error occurred"); }
      }

      // Return to calling method
      return;
    }
    #endregion
  }
}
